package com.lc.reader.data.repository

import com.lc.reader.data.dao.BookmarkDao
import com.lc.reader.data.model.Bookmark
import kotlinx.coroutines.flow.Flow

class BookmarkRepository(
    private val bookmarkDao: BookmarkDao
) {
    
    fun getBookmarksByBookId(bookId: Long): Flow<List<Bookmark>> = 
        bookmarkDao.getBookmarksByBookId(bookId)
    
    fun getAllBookmarks(): Flow<List<Bookmark>> = bookmarkDao.getAllBookmarks()
    
    suspend fun insertBookmark(bookmark: Bookmark): Long = bookmarkDao.insertBookmark(bookmark)
    
    suspend fun updateBookmark(bookmark: Bookmark) = bookmarkDao.updateBookmark(bookmark)
    
    suspend fun deleteBookmark(bookmark: Bookmark) = bookmarkDao.deleteBookmark(bookmark)
    
    suspend fun deleteBookmarksByBookId(bookId: Long) = bookmarkDao.deleteBookmarksByBookId(bookId)
    
    suspend fun deleteBookmarkById(bookmarkId: Long) = bookmarkDao.deleteBookmarkById(bookmarkId)
}
